package com.pets.book.aop.controller;

import com.pets.book.aop.service.BooKAopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("com/pets/book")
public class BookAopController {

    @Autowired
    private ApplicationContext context;

    @GetMapping("/test/aop")
    public void testAop(){
        BooKAopService service = context.getBean(BooKAopService.class);
        service.testAop();
    }

    @RequestMapping("/test/aops")
    public void testAops(){
        BooKAopService service = context.getBean(BooKAopService.class);
        service.testAop();
    }

    @PostMapping("/get/aops")
    public void getAops(){
        BooKAopService service = context.getBean(BooKAopService.class);
        service.testAop();
    }

    @PatchMapping("/get/aops")
    public void patchAops(){
        BooKAopService service = context.getBean(BooKAopService.class);
        service.testAop();
    }

}
